<template>
  <div>
      <!-- include缓存的组件  
        exclude 不缓存的组件 -->
      <keep-alive include="one,two" exclude="three">
            <component :is="comName" />
      </keep-alive>
      <button @click="comName='cartOne'">第一个</button>
       <button @click="comName='cartTwo'">第二个</button>
      <button @click="comName='cartThree'">第三个</button>
  </div>
</template>

<script>
import cartOne from './cartOne.vue'
import cartTwo from './cartTwo.vue'
import cartThree from './cartThree.vue';

export default {
  name: '2304BIndex',
components:{
  cartOne,
  cartTwo,
  cartThree
},
  data() {
    return {
       comName:'cartOne'
    };
  },

  mounted() {
    
  },

  methods: {
    
  },
};
</script>